home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / Macintosh Tracker 1.1 Source / Tracker Server Folder / channel.h < prev    next >
Text File  |  1993-05-18  |  4KB  |  125 lines

  1. /* channel.h */
  2.  
  3. /* $Id: channel.h,v 3.5 1992/11/27 10:29:00 espie Exp espie $
  4.  * $Log: channel.h,v $
  5.  * Revision 3.5  1992/11/27  10:29:00  espie
  6.  * General cleanup
  7.  *
  8.  * Revision 3.4  1992/11/23  10:12:23  espie
  9.  * *** empty log message ***
  10.  *
  11.  * Revision 3.3  1992/11/22  17:20:01  espie
  12.  * Simplified delay_pattern.
  13.  *
  14.  * Revision 3.2  1992/11/20  14:53:32  espie
  15.  * Added finetune.
  16.  *
  17.  * Revision 3.1  1992/11/19  20:44:47  espie
  18.  * Protracker commands.
  19.  *
  20.  * Revision 3.0  1992/11/18  16:08:05  espie
  21.  * New release.
  22.  *
  23.  * Revision 2.7  1992/11/13  13:24:24  espie
  24.  * Added parameters for extended Retriger command.
  25.  * Added transpose feature.
  26.  * Structured part of the code, especially replay ``automaton''
  27.  * and setting up of effects.
  28.  *
  29.  * Revision 1.5  1991/11/16  16:54:19  espie
  30.  * Bug correction: when doing arpeggio, there might not
  31.  * be a new note, so we have to save the old note value
  32.  * and do the arppeggio on that note.
  33.  * Added fields for arpeggio.
  34.  */
  35.  
  36.      
  37. #ifndef NUMBER_PATTERNS
  38. #define NUMBER_PATTERNS 128
  39. #endif
  40.  
  41. /* DO_NOTHING is also used for the automaton */
  42. #define DO_NOTHING 0
  43. #define PLAY 1
  44. #define REPLAY 2
  45.      
  46. #define MAX_ARP 3
  47.      
  48. /* there is no note in each channel initially.
  49.  * This is defensive programming, because some
  50.  * commands rely on the previous note. Checking
  51.  * that there was no previous note is a way to
  52.  * detect faulty modules.
  53.  */
  54. #define NO_NOTE 255
  55.  
  56. struct channel
  57.     {
  58.     struct sample_info *samp;
  59.     int mode;               /* automaton state for the sound generatio */
  60.     unsigned long pointer;   /* current sample position (fixed pos) */
  61.     unsigned int step;      /* sample position increment (gives pitch) */
  62.     int finetune;
  63.     int volume;             /* current volume of the sample (0-64) */
  64.     int pitch;              /* current pitch of the sample */
  65.     int cpitch;
  66.     int note;               /* we have to save the note cause */
  67.                             /* we can do an arpeggio without a new note */
  68.     
  69.     int arp[MAX_ARP];       /* the three pitch values for an arpeggio */
  70.     int arpindex;           /* an index to know which note the arpeggio is doing
  71.                              */
  72.  
  73.     int viboffset;          /* current offset for vibrato (if any) */
  74.     int vibdepth;           /* depth of vibrato (if any) */
  75.  
  76.     int slide;              /* step size of pitch slide */
  77.  
  78.     int pitchgoal;          /* pitch to slide to */
  79.     int pitchrate;          /* step rate for portamento */
  80.  
  81.     int volumerate;         /* step rate for volume slide */
  82.  
  83.     int vibrate;            /* step rate for vibrato */
  84.  
  85.     int retrig;             /* delay for extended retrig command */
  86.     int current;
  87.  
  88.     void (*adjust)();       /* current command to adjust parameters */
  89.     };
  90.  
  91. /* DO_NOTHING was already declared for the channel
  92.    #define DO_NOTHING 0 */
  93. #define SET_SPEED 1
  94. #define SET_SKIP 2
  95. #define SET_FASTSKIP 4
  96.  
  97. #define JUMP_PATTERN 8
  98. #define DELAY_PATTERN 16
  99.  
  100. #define NORMAL_SPEED 6
  101. #define NORMAL_FINESPEED 125
  102.  
  103. struct automaton
  104.     {
  105.     int pattern_num;            /* the pattern in the song */
  106.     int note_num;               /* the note in the pattern */
  107.     struct block *pattern;      /* the physical pattern */
  108.     struct song_info *info;     /* we need the song_info */
  109.  
  110.     char gonethrough[NUMBER_PATTERNS + 1];  /* to check for repeats */
  111.  
  112.     int counter;                /* the fine position inside the effect */
  113.     int speed;                  /* the `speed', number of effect repeats */
  114.     int finespeed;              /* the finespeed, base is 100 */
  115.  
  116.     int do_stuff;               /* keeping some stuff to do */
  117.                                 /* ... and parameters for it: */
  118.     int new_speed, new_note, new_pattern, new_fastspeed;
  119.  
  120.     int pitch, note, para;      /* some extra parameters effects need */
  121.  
  122.     int loop_pattern_num, loop_note_num, loop_counter;
  123.                                 /* for command E6 */
  124.     };
  125.